<?php

	$dataBase = new DataBase_AppTest();
	//$dataBase->addNewUser("12345","test","test_user01","http://www.baidu.com",1,15);

	Class DataBase_AppTest
	{
		private $link;

		function __construct()
		{
			$this->link = mysqli_connect("localhost","root","","app_test");
			if($this->link)
			{
			}
			else
			{
				echo("sql connect error!");
			}
		}

		public function creatNewUser($pid, $platform, $name, $head, $sex, $age)
		{
			$sql_query = "INSERT INTO user " .
				"(pid,platform,name,head,sex,age) VALUES ('".
				$pid."','".$platform."','".$name."','".$head."','".$sex."','".$age."')";
			//echo($sql_query);
			mysqli_query($this->link,$sql_query);
		}

		public function creatNewCommunity($name, $range, $shi, $shen, $isuser)
		{
			$sql_query = "INSERT INTO community " .
				"(name,range,shi,shen,isuser) VALUES ('".
				$name."','".$range."','".$shi."','".$shen."','".$isuser."')";
			//echo($sql_query);
			mysqli_query($this->link,$sql_query);
		}
	}
?>